package com.zh.service.impl;
import java.math.BigDecimal;
import java.util.Date;

import com.zh.pojo.domain.DriverWallet;
import com.zh.mapper.DriverWalletMapper;
import com.zh.service.IDriverWalletService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 司机的钱包 服务实现类
 * </p>
 *
 * @author 初四
 * @since 2024-06-13
 */
@Service
public class DriverWalletServiceImpl extends ServiceImpl<DriverWalletMapper, DriverWallet> implements IDriverWalletService {

    /**
     * 保存司机的钱包
     * @param id
     */
    @Override
    public void saveDriverWallet(Long id) {
        DriverWallet driverWallet = new DriverWallet();
        driverWallet.setId(id);
        driverWallet.setAmount(new BigDecimal("0"));
        driverWallet.setCreateTime(new Date());
        driverWallet.setTotalRecharge(new BigDecimal("0"));
        driverWallet.setTotalWithdraw(new BigDecimal("0"));
        super.save(driverWallet);
    }
}
